package main

import (
	"eci-forward/pkg/config"
	"eci-forward/pkg/logs"
	"eci-forward/pkg/redis"
	v2 "eci-forward/pkg/router/v2"

	_ "eci-forward/docs"

	"github.com/gin-gonic/gin"
	swaggerFiles "github.com/swaggo/files"
	ginSwagger "github.com/swaggo/gin-swagger"
	"go.uber.org/zap"
)

// @title ECI Forward API
// @version 1
// @description This is a sample ECI Forward API server.
// @termsOfService http://localhost:4563/swagger/
// @contact name
// @license MIT
// @BasePath /
func main() {
	config.Init()
	logs.Init()
	redis.Init()
	logs.Logger.Info("init complete", zap.Any("config", config.GetConfig()))

	r := gin.Default()
	r.GET("/swagger/*any", ginSwagger.WrapHandler(swaggerFiles.Handler))
	// v1.Aggregation(r)
	v2.Aggregation(r)
	r.Run(":4563")
}
